#ifndef FILEHANDLER_H
#define FILEHANDLER_H



#include "fileutils_global.h"



#include <AbstractSerializer.h>
#include <AbstractItem.h>
#include <QObject>
#include <QPointer>



class FILEUTILSSHARED_EXPORT FileHandler : public QObject
{
    Q_OBJECT
public:



    static void installSerializer(AbstractSerializer* serializer);

    static bool save(const QString& file_path, AbstractItem* item = 0);
    static AbstractItem* open(const QString& file_path);


protected:
    static FileHandler* instance();

    FileHandler(QObject *parent = 0);

    QPointer<AbstractSerializer> m_serializer;


};

#endif // FILEHANDLER_H
